package weekMatch.one_337;

import java.util.Arrays;

public class LeeCode_01 {
    public static void main(String[] args) {
        System.out.println(Arrays.toString(evenOddBit(17)));
        System.out.println(Arrays.toString(evenOddBit(2)));
    }
    private static int[] evenOddBit(int n) {
        int[] ans = new int[2];
        int a1 = 0, a2 = 0;
        for (int i = 0; i < 10; i++) {
            int num = n & (1 << i);
            if (num != 0){
                if (i % 2 == 0)
                    a2++;
                else
                    a1++;
            }
        }
        ans[0] = a2;
        ans[1] = a1;
        return ans;
    }
}
